package pl.edu.mimuw.mas.agent;

import java.util.Date;

import pl.edu.mimuw.mas.utils.ColorUtils;

/**
 * Rozszerzenie {@link AgentPossition} pozwalające na wyświetlanie dodatkowych
 * informacji w GUI.
 */
public class AgentPossitionExtended extends AgentPossition {
	
	private String aid;
	private boolean printable;
	
	private Date lastEventDate;
	private int eventCount;
	
	private int r, g, b;
	private boolean overrideColor;
	
	private String info;	

	public AgentPossitionExtended(String aid, String label, Date lastEventDate, 
			int x, int y, float z, boolean printable, 
			int r, int g, int b) {		
		super(label, x, y, z, ColorUtils.toFloat(r, g, b));

		this.aid = aid;
		this.printable = printable;

		this.lastEventDate = lastEventDate;
		this.eventCount = 1;

		this.r = r;
		this.g = g;
		this.b = b;
		this.overrideColor = false;
	}

	public void setColor(int r, int g, int b) {
		this.r = r;
		this.g = g;
		this.b = b;
		
		setColor(ColorUtils.toFloat(r, g, b));
	}
	
	public String getAid() {
		return this.aid;
	}

	public boolean isPrintable() {
		return this.printable;
	}

	public void setPrintable(boolean printable) {
		this.printable = printable;
	}

	public Date getLastEventDate() {
		return this.lastEventDate;
	}

	public void setLastEventDate(Date lastEventDate) {
		this.lastEventDate = lastEventDate;
		this.eventCount++;
	}

	public int getEventCount() {
		return this.eventCount;
	}

	public int getR() {
		return this.r;
	}

	public int getG() {
		return this.g;
	}

	public int getB() {
		return this.b;
	}
	
	public boolean isOverrideColor() {
		return this.overrideColor;
	}

	public void setOverrideColor(boolean overrideColor) {
		this.overrideColor = overrideColor;
	}
	
	public String getInfo() {
		return this.info;
	}
}
